function [ test_prefs test_sets test_anns train_prefs train_sets train_anns valid_prefs valid_sets valid_anns ] = splitDataTTV(data)
disp('Get test and train sets: Starting.');
num_cams = size(data,1);
test_sets = cell(num_cams, 1);
valid_sets = cell(num_cams, 1);
train_sets = cell(num_cams, 1);
test_prefs = cell(num_cams, 1);
valid_prefs = cell(num_cams, 1);
train_prefs = cell(num_cams, 1);
test_anns = cell(num_cams, 1);
train_anns = cell(num_cams,1);
valid_anns = cell(num_cams,1);
for ix = 1:num_cams;
    [ data_out  test_pref test_input test_ann train_pref train_input train_ann valid_pref valid_input valid_ann ] = getSets(data(ix, :));
    test_sets{ix} = test_input;
    test_prefs{ix} = test_pref;
    test_anns{ix} = test_ann;
    train_sets{ix} = train_input;
    train_prefs{ix} = train_pref;
    train_anns{ix} = train_ann;
    valid_sets{ix} = valid_input;
    valid_prefs{ix} = valid_pref;
    valid_anns{ix} = valid_ann;
    data(ix,:) = data_out;
end
disp('Get test and train and valid sets: Done.');
end